package com.lizhi;

import java.awt.Frame;
import java.awt.Graphics;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

@SuppressWarnings("serial")
public class TankFrame extends Frame{
	
	public TankFrame() {
		this.setSize(800, 600); //设置大小
		this.setResizable(false); //设置是否可以改变大小
		this.setTitle("坦克大战"); //设置标题

		//为当前窗口添加监听
		this.addWindowListener(new WindowAdapter() {
			@Override
			public void windowClosing(WindowEvent e) {
				System.exit(0);
			}
		});
	}

	@Override
	public void paint(Graphics g) {
		g.fillRect(200, 200, 50, 50);
	}
}
